
#ifndef SHIP_H
#define SHIP_H
#include <QPixmap>
#include "QTimerEvent"
#include <config.h>


class ship
{

public:
    ship(int b)
    {
        if(b==1)
             path="://res//hangmu1.png";
        if(b==2)
            path="://res//hangmu2.png";
        if(b==3)
            path="://res//hangmu3.png";
        if(b==4)
          path="://res//xiaochuan1.png";
        if(b==5)
            path="://res//kzqj.png";
        if(b==6)
             path="://res//xiaochuan2.png";
        //初始化坐标
          // 定义一个空白图像
        m_Ship.load(path);
        m_X = GAME_WIDTH * 0.5 - m_Ship.width()*0.5;
        m_Y = GAME_HEIGHT - m_Ship.height();

        //初始化矩形框
        m_Rect.setWidth(m_Ship.width());
        m_Rect.setHeight(m_Ship.height());
        m_Rect.moveTo(m_X,m_Y);

    }
    QString path;
QImage image;
    //ship(int b)
       // ;
    //void timerEvent(QTimerEvent *event);
    //M_ship.load(HERO_PATH);
    //设置飞机位置
    void setPosition(int x, int y);

public:
    //飞机资源 对象
    QPixmap m_Ship;

    //飞机坐标
    int m_X;
    int m_Y;

    //飞机的矩形边框
    QRect m_Rect;
};

#endif // SHIP_H
